<template>
    <div>

        我是子组件


        <div class="slot-info">
            <slot data="实际参数？"></slot>
        </div>
    </div>
</template>

<style scoped lang="scss">
.slot-info{

    width: 400px;
    height: 400px;
    border: 1px solid green;

}
</style>

<script setup>
import { inject, onMounted,provide } from 'vue';


const props =  defineProps({
    info:{
        type:String
    }
})

const emit= defineEmits(['dataEmits'])


console.log("获取基础数据");
console.log(props.info);


// const fatherInfo=inject('fater');


provide("xxx",true)


 

onMounted(()=>{
   emit('dataEmits',"我是子组件传递到父组件的参数");
})
</script>


